package com.nervenets.web.redis.domain.user;

import com.nervenets.web.enumeration.WealthType;
import com.nervenets.web.redis.RedisOrderedSetDomain;
import lombok.Data;

/**
 * 账户余额排行
 * Created by Joe on 2018/1/24.
 */
@Data
public class WealthOfMoney extends RedisOrderedSetDomain {
    private long userId;
    private WealthType wealthType;
    private int money;

    public WealthOfMoney(long userId, WealthType wealthType) {
        this.userId = userId;
        this.wealthType = wealthType;
    }

    @Override
    public double getOrderedValue() {
        return money;
    }

    @Override
    public String getField() {
        return String.valueOf(userId);
    }

    @Override
    public String getKey() {
        return String.format("WEALTH_OF_%s", wealthType.name().toUpperCase());
    }
}
